import request from '@/utils/request'

export default {

  //添加课程
  addCourse(data) {
    return request({
      url: "/course",
      method: "post",
      data
    })
  },
  //查询课程
  getCourseById(courseId) {
    return request({
      url: `/course/${courseId}`,
      method: "get"
    })
  },
  //查询 发布课程的信息
  findPublishById(courseId) {
    return request({
      url: `/course/publish/find/${courseId}`,
      method: "get"
    })
  },
  //发布课程
  publish(courseId) {
    return request({
      url: `/course/publish/${courseId}`,
      method: "put"
    })
  },

  //查询课程
  findCourse(currentPage, pageSize) {
    return request({
      url: `/course/search/${currentPage}/${pageSize}`,
      method: "get"
    })
  },

}
